#ifndef INDEXTHREAD_H
#define INDEXTHREAD_H

#include "search.h"
#include <QThread>
#include <QFile>
#include <QString>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QList>

class IndexThread : public QThread
{
    Q_OBJECT

    QList<Searched> word_list;
    QList<QString> file_list;

    void goto_sub_dir(QString path);
    QList<Searched> read_file(QString file_name);
    QList<Searched> lexer();

public:
    QString dir;
    QString file_name;
    bool is_all_index;
    void run();

signals:
    void send_file_msg(int, int, QString, QString);
    void send_finished();
    void send_error(QString, QString, QString);
};

#endif // INDEXTHREAD_H
